package com.whfp.coky.ui.task.model

import android.os.Parcel
import android.os.Parcelable

/**
 *
 *
 * created by coky on 2022/3/18
 */
class FluorSettingBean() : Parcelable{
    var isCoverOldProj: Boolean = false//读取项目时覆盖旧项目
    var isShowResult: Boolean = false//显示定量结果
    var detecType: Boolean = false//标准/快速检测
    var lowUpCaculate: Boolean = false//下位机计算/上位机计算
    var isAlarm: Boolean = false//声光报警
    var curveType:Int = 1//标曲选择方式

    constructor(parcel: Parcel) : this() {
        isCoverOldProj = parcel.readByte() != 0.toByte()
        isShowResult = parcel.readByte() != 0.toByte()
        detecType = parcel.readByte() != 0.toByte()
        lowUpCaculate = parcel.readByte() != 0.toByte()
        isAlarm = parcel.readByte() != 0.toByte()
        curveType = parcel.readInt()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeByte(if (isCoverOldProj) 1 else 0)
        parcel.writeByte(if (isShowResult) 1 else 0)
        parcel.writeByte(if (detecType) 1 else 0)
        parcel.writeByte(if (lowUpCaculate) 1 else 0)
        parcel.writeByte(if (isAlarm) 1 else 0)
        parcel.writeInt(curveType)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<FluorSettingBean> {
        override fun createFromParcel(parcel: Parcel): FluorSettingBean {
            return FluorSettingBean(parcel)
        }

        override fun newArray(size: Int): Array<FluorSettingBean?> {
            return arrayOfNulls(size)
        }
    }


}